Forum:CSS Styling for tables
Hi folks. I've been working on some more CSS Styling rules that I hope should make the creation of tables much more accessible and 'cleaner' than the current process. Often when creating tables one has to specify style rules for almost every cell of the table. This is hardly ideal. The CSS code I've placed in my own user style sheet (User:Dammej/wikia.css - starting from the /* table stuff... */ comment and ending at /* END table CSS */ comment) works to solve this issue by providing sensible styling defaults for our tables with a simple class definition at the top of the table. To see this in action, check out the my page at User:Dammej/Sandbox/Table CSS after having added the CSS to your own user profile at . As the stylesheet page says, you may have to force a refresh to your browser's cache in order to see the new styles after you make the change. This isn't really going to change a whole lot on current pages, but it should make the creation of new tables much simpler from here on out. When you ask "why the hell should I care about this", compare the wiki code for tables that don't use the new CSS style to the wiki code for the tables that do use the new CSS style. I think you'll find that the tables using the new style sheets are generally devoid of incomprehensible styling rules, and contain only the meat (content) of the table itself. Oh, I totally forgot. The proposal itself: # Move these CSS rules into MediaWiki:Wikia.css to make them apply site-wide. # Update existing tables to use these new style rules where it makes sense # Create a section in the MEW:Manual of Style detailing how to create a table using the new style classes. See the top of User:Dammej/Sandbox/Table CSS for what I've drafted up so far. Anyway, that's all I've got. Comments/Questions/Concerns/Criticisms/Trojan Horses are welcome. Comments I like this proposal a great deal. Even without a visual comparison of the tables themselves (I'll add the code to my page and check it out in the morning), the difference in what we have to set up in the editing space is tremendous. We'd be going from huge blocks of code to a handful of characters to get the same tables. I don't see a downside. This has my support. -- Commdor (Talk) 09:58, June 26, 2011 (UTC) :You guys know I don't know jack about this code stuff. That said, if the two of you like it and say it'll make things easier for those of you who do understand this nonsense, you've got my support. SpartHawg948 10:07, June 26, 2011 (UTC) ::Thanks for the support! Your comment does remind me of something I should have mentioned before Re: tables. Right now we don't have anything in our MoS/CG which talks about making wikitables (at least I couldn't find anything quickly). This surprises me, given the prevalence of tables here. Part of this proposal would have been to amend that section to use these styles by default... but since it doesn't exist I guess it would have to be created instead. I'll work on some verbage for that and then make it available here for review. -- Dammej (talk) 13:17, June 26, 2011 (UTC) :::Update: I've drafted up a short blurb to include in the MoS which briefly details how tables work. Have a look at the top of User:Dammej/Sandbox/Table CSS to see what I've come up with, and feel free to provide your input/revisions here. Thanks! -- Dammej (talk) 01:16, June 30, 2011 (UTC) ::::I agree with these proposal, though I must ask, does that means the grid lines in the table will be gone as well? It seems like lines are gone in the CSS version — Teugene (Talk) 03:23, June 30, 2011 (UTC) :::::No-- they don't show up because you haven't copied the prototype CSS from my style sheet to yours. If/when the proposal passes, that'll get moved into the site-wide CSS. -- Dammej (talk) 03:26, June 30, 2011 (UTC) ::::::Ah that's right... very silly of me. Now I see it and like it. I give my 110% support! ;) — Teugene (Talk) 03:36, June 30, 2011 (UTC) I had a similar discussion about tables and styling in general with DRY in the MoS/Colorsa while back (nothing was resolved in that discussion). I don't want to start messing with my user styles just yet (so I don't know how it looks) but I agree with with the general idea. --silverstrike 16:56, July 2, 2011 (UTC) :I have to admit, I like what I'm seeing here, just really a few things, small ones. I would like to see the white lines back as the new color tends to blend with the background color, but if white isn't preferred, then perhaps another color that stands out just a little more than the current one. Also can the headings and other columns be in different colors or is this the one we are stuck with? Lancer1289 17:05, July 5, 2011 (UTC) ::You like the white borders? Ack, I thought that was an unintended consequence of code that wasn't cross-platform (and is part of the reason I wanted to make this general style). We can choose a color that stands out more, but I think white is way to garish. ::Background colors of cells can always be overwritten as before, but the intention is that this would be the exception rather than the norm. Adding extra "style=..." stuff should not happen too often. ::I've added some other classes to aid with overriding the background color of an entire row. For instance, placing |- class="altbackground" style="background: #223" as the style for a row will make each cell in that row use the background color specified in the style="..." setting for that row. -- Dammej (talk) 23:57, July 5, 2011 (UTC) :::I really just wanted to know if we could pick something apart from the color that blends in a little too well as I'd rather have the lines stand out a little more so it makes the table easier to follow. That's really my only gripe with this, and now knowing that it can be overridden, I really can't find anything to complain about. Well at the moment anyway. Lancer1289 00:30, July 6, 2011 (UTC) :::*Addendum: For a more general color, might I recommend this. Lancer1289 00:36, July 6, 2011 (UTC) ::::Thats... well, that does not look good to me. The intention of this styling was to use the exact same color scheme that's already seen everywhere on the wiki. This color scheme is seen in the forum headers, it's seen in the character template, it's seen in most of the ME info boxes, it's seen in the footer templates, etc, etc. I don't see why we should mess with a color scheme that's literally used everywhere else in the wiki. -- Dammej (talk) 00:49, July 6, 2011 (UTC) :::::I must say, that blue looks really bad, even as a text colour! On the other hand, I agree with Dammej in using that standardize colours that has been used throughout this wikia. Which reminds me of a certain article with tables colours that needs to be changed for consistency.. — Teugene (Talk) 02:39, July 6, 2011 (UTC)